package com.yan.demo;

import java.io.*;
import java.nio.charset.Charset;

/**
 * @author taoge
 * @Date 2024/8/6 11:40
 * @Description 打印字符流
 *              打印字节流
 *              往文件中打印
 */
public class Demo2 {
    public static void main(String[] args) throws IOException {
        PrintStream ps = new PrintStream(new FileOutputStream("D:\\IdeaProject\\javaSE-Plus\\day12_code\\src\\com\\yan\\demo\\Print.txt"), true , "UTF-8");
        ps.println("你好");
        ps.println("abc");
        ps.println(1000);
        ps.close();

        PrintWriter pw = new PrintWriter(new FileOutputStream("D:\\IdeaProject\\javaSE-Plus\\day12_code\\src\\com\\yan\\demo\\Print.txt") , true , Charset.forName("UTF-8"));


    }

}
